package com.xz.group12306.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.xz.group12306.business.service.ManagerService;
import com.xz.group12306.business.service.impl.ManagerServiceImpl;
import com.xz.group12306.domain.Ticket;

/**
 * 管理员修改车票Servlet
 */
@WebServlet("/ManageUpdateTicketServlet")
public class ManageUpdateTicketServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * 构造方法
	 */
	public ManageUpdateTicketServlet() {
		super();
	}

	/**
	 * doGet方法
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String TicketID = request.getParameter("TicketID");
		ManagerService managerService=new ManagerServiceImpl();
		Ticket ticket = managerService.findTicket(Integer.parseInt(TicketID));
		HttpSession session = request.getSession();
		// List<User> users=manageService.getUserList(pageSize, start, user);
		session.setAttribute("ticket", ticket);
		response.sendRedirect("admin/ManageModifyTicket.jsp");
	}

	/**
	 * doPost方法
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
